
package com.audi.user.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name = "tbl_city")
public class City implements java.io.Serializable{
    
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * cityId       db_column: city_id 
     */ 	
	
	private Long cityId;
    /**
     * provinceId       db_column: province_id 
     */ 	
	
	private Long provinceId;
    /**
     * alias       db_column: alias 
     */ 	
	//@Length(max=32)
	private java.lang.String alias;
    /**
     * cityName       db_column: city_name 
     */ 	
	//@Length(max=32)
	private java.lang.String cityName;
    /**
     * longitude       db_column: longitude 
     */ 	
	
	private Double longitude;
    /**
     * latitude       db_column: latitude 
     */ 	
	
	private Double latitude;
	//columns END


	public City(){
	}

	public City(
		Long cityId
	){
		this.cityId = cityId;
	}

	

	public void setCityId(Long value) {
		this.cityId = value;
	}
	
	@Id 
	//@SequenceGenerator(name="city_SEQ",sequenceName="seq_city")
    //@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="city_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "city_id")
	public Long getCityId() {
		return this.cityId;
	}
	
	@Column(name = "province_id")
	public Long getProvinceId() {
		return this.provinceId;
	}
	
	public void setProvinceId(Long value) {
		this.provinceId = value;
	}
	
	@Column(name = "alias",length=32)
	public java.lang.String getAlias() {
		return this.alias;
	}
	
	public void setAlias(java.lang.String value) {
		this.alias = value;
	}
	
	@Column(name = "city_name",length=32)
	public java.lang.String getCityName() {
		return this.cityName;
	}
	
	public void setCityName(java.lang.String value) {
		this.cityName = value;
	}
	
	@Column(name = "longitude")
	public Double getLongitude() {
		return this.longitude;
	}
	
	public void setLongitude(Double value) {
		this.longitude = value;
	}
	
	@Column(name = "latitude")
	public Double getLatitude() {
		return this.latitude;
	}
	
	public void setLatitude(Double value) {
		this.latitude = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("CityId",getCityId())
			.append("ProvinceId",getProvinceId())
			.append("Alias",getAlias())
			.append("CityName",getCityName())
			.append("Longitude",getLongitude())
			.append("Latitude",getLatitude())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getCityId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof City == false) return false;
		if(this == obj) return true;
		City other = (City)obj;
		return new EqualsBuilder()
			.append(getCityId(),other.getCityId())
			.isEquals();
	}
}

